<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>管理员登录</button><br>
    <hr>
    <button>修改管理员密码</button><br> 
    <!-- 引入axios  -->
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <!-- 登录 -->
    <script>
        document.querySelectorAll('button')[0].onclick=()=>{
            //get方法没有请求主体 可使用/aname/apwd 传参 
            axios.get('http://127.0.0.1:8090/admin/login/admin/123456').then(res=>{ 
                console.log(res.data)
            }).catch(err=>{
                console.log(err)
            })
        }
    </script>
    <!-- 修改 -->
    <script>
    document.querySelectorAll('button')[1].onclick=()=>{
            let data={aname:'admin',oldPwd:'666666',newPwd:'666666'}; 
            axios.patch('http://127.0.0.1:8090/admin/admin',data).then(res=>{ 
                console.log(res.data)
            }).catch(err=>{
                console.log(err)
            })
        }
    </script>
  
    
</body>
</html>